package com.jxm.jdk8features;

import java.util.Objects;

/**
 * @Author: jxm
 * @Description:
 * @Date: 2023-12-21 16:42
 * @Version: 1.0
 */
public class Employee {

    private Integer number;
    private String name;
    private Integer age;
    private Integer salary;

    public Employee() {
    }
    public Employee(Integer number, String name) {
        this.number = number;
        this.name = name;
    }

    public Employee(Integer number, String name, Integer age, Integer money) {
        this.number = number;
        this.name = name;
        this.age = age;
        this.salary = money;
    }

    public Integer getNumber() {
        return number;
    }

    public void setNumber(Integer number) {
        this.number = number;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public Integer getSalary() {
        return salary;
    }

    public void setSalary(Integer salary) {
        this.salary = salary;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Employee employee = (Employee) o;
        return Objects.equals(number, employee.number) && Objects.equals(name, employee.name) && Objects.equals(age, employee.age) && Objects.equals(salary, employee.salary);
    }

    @Override
    public int hashCode() {
        return Objects.hash(number, name, age, salary);
    }
}
